package com.chang.annotation.resource.service;


import com.chang.annotation.resource.dao.UserDao;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service("myUserService")
public class UserServiceImpl implements UserService {

    // @Resource(name = "myUserDao")
    @Resource(name = "redis")
    // 当resource注解使用时没有指定名称，依然会根据属性名进行查找，也就是这里private UserDao userDao的userDao,如果属性名也不一致的话就会根据byType查找
    private UserDao userDao;

    @Override
    public void add() {
        userDao.add();
        System.out.println("Service:add>>>>>>>>>>");
    }
}
